The present invention relates to an image data compression device and an encoder.
Moving Picture Experts Group Phase 4 (MPEG-4) has been standardized as a general-purpose coding method for multimedia information such as image data of a still image or a moving image and sound data. A recent portable instrument realizes encoding and decoding of image data conforming to the MPEG-4 standard, and can perform moving image reproduction and transmission/reception through a network.
In the MPEG-4 standard, compressed data obtained by encoding image data of a moving image must be generated at a constant rate. However, when compressing image data of a moving image, the compression efficiency changes to a large extent depending on the type of image data. MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999 (E) Annex L) describes a rate control method for generating compressed data at a constant rate by controlling the amount of code to be generated so that such a change is limited within a predetermined range.
When performing MPEG-4 encode (compression) processing, a series of processing may be entirely performed by hardware. However, since this results in an increase in the circuit scale, it is difficult to achieve a reduction of size when integrating circuits in an IC (semiconductor device or integrated circuit). In particular, a portable instrument such as a portable telephone cannot satisfy a demand for a reduction of the size of the instrument.
A series of encode processing may be entirely performed by using software. However, this increases the load imposed on a central processing unit (CPU) which processes the software. Therefore, the time necessary for the CPU to perform another processing is limited, whereby the performance of an instrument provided with the CPU is decreased. Moreover, since the processing time of the CPU is increased, power consumption is increased. In particular, a portable instrument such as a portable telephone cannot satisfy a demand for a reduction of power consumption in order to maintain battery life.
Therefore, a series of encode processing may be allocated between hardware and software. However, as a result of studies conducted by the present inventors, it was found that the rate control method disclosed in MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999 (E) Annex L) cannot be performed when optimizing the allocation of a series of encode processing between hardware and software. Therefore, optimization of allocation of image data compression processing between hardware and software and generation of compressed data at a constant rate cannot be achieved in combination.
According to the rate control method described in MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999 (E) Annex L), even if the generation rate of compressed data can be controlled, block noise is generally displayed in the image generated by decompressing the compressed data, whereby the display quality may deteriorate.
On the other hand, the amount of compressed data is increased in order to prevent deterioration of the display quality, whereby a desired rate may not be maintained.